home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5132 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  41 lines

  1. Path: earth.superlink.net!usenet
  2. From: Michael Rizzo <rizzom@mars.superlink.net>
  3. Newsgroups: comp.lang.c
  4. Subject: Q: pointers to pointers that point to structs?
  5. Date: Fri, 09 Feb 1996 23:13:02 -0500
  6. Organization: SuperNet Inc. (908) 828-8988
  7. Message-ID: <311C1B4E.217F@mars.superlink.net>
  8. NNTP-Posting-Host: ez16.superlink.net
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (Win95; I)
  13.  
  14. Hi,
  15.  
  16.   I am having trouble dereferencing a pointer to a pointer to a struct.
  17. For simplicity just say the struct is:
  18. struct test
  19.   {
  20.   char teststr[10];
  21.   int  testint;
  22.   }
  23.  
  24. Now I have a function that just wants to print elements of the 
  25. structure:
  26.  
  27. void f(test **temp)
  28. {
  29. printf("%s  %d",(please fill in the blank))
  30. }
  31.  
  32. How to I get to test.teststr and test.testint from within the funtion.
  33. I have tried temp->teststr.  I'm still pretty new to programming in C, 
  34. and the book I'm using does not go into such topics, so any help would 
  35. be greatly appreciated.  
  36.  
  37. Thanks
  38.  
  39. Mike Rizzo
  40. e-mail:  rizzom@mars.superlink.net
  41.